$(function () {
    LoadAccount();
    load();
})

function LoadAccount() {
    $.post("/Account.do/LoadAccount",function (sdata) {
        console.log(sdata);
        $.each(sdata, function (key, value) {
            if (key != "renglish" || key != "rmarital") {
                $("input[name=" + key + "]").val(value)
            }
        })
        $("#imageid").prop("src", "/image/" + sdata.image);
        $("#rpersonality").text(sdata.rpersonality);
        let sex = " <input type=\"radio\" " + (sdata.rsex == 0 ? 'checked' : '') + "  class=\"XsYc\" style=\"width: 17px;height: 17px;\" name=\"rsex\" value=\"0\" disabled> &nbsp;男 &nbsp;" +
            " <input type=\"radio\"  " + (sdata.rsex == 1 ? 'checked' : '') + "  class=\"XsYc\" style=\"width: 17px;height: 17px;\" name=\"rsex\" value=\"1\" disabled>  &nbsp;女"
        $("#sex").html(sex);
        let renglish = "<option " + (sdata.renglish == 0 ? 'selected' : '') + " value=\"0\">不好</option>\n" +
                        " <option " + (sdata.renglish == 1 ? 'selected' : '') + " value=\"1\">良好</option>\n" +
                        "  <option " + (sdata.renglish == 2 ? 'selected' : '') + " value=\"2\">优秀</option>"
        $("#renglish").html(renglish);
        let rmarital = " <option " + (sdata.rmarital == 0 ? 'selected' : '') + " value=\"0\">未婚</option>\n" +
            "      <option " + (sdata.rmarital == 1 ? 'selected' : '') + " value=\"1\">已婚</option>";
        $("#rmarital").html(rmarital);
    })
}

function UpDate() {
    $(".XsYc").prop("disabled", false);
    $("#btn").prop("type", "submit");
}

// 刷新页面
function load() {
    $("#table").bootstrapTable("refresh");
}



